home *** CD-ROM | disk | FTP | other *** search
- Path: ix.netcom.com!netnews
- From: froman@ix.netcom.com(James Edward Sands III )
- Newsgroups: comp.lang.c++
- Subject: NEWBIE:strings, spacing, white_spacing
- Date: 2 Feb 1996 06:29:03 GMT
- Organization: Netcom
- Message-ID: <4esavf$sqb@cloner4.netcom.com>
- References: <3111CD7E.2A81@dg.com>
- NNTP-Posting-Host: ix-den8-12.ix.netcom.com
- X-NETCOM-Date: Thu Feb 01 10:29:04 PM PST 1996
-
-
-
- Ok,
- I am reading a string (actually many) heres a sample,
-
- #include<iostream.h>
- #include<stdio.h>
- #include<cstring.h>
- static int skip_whitespace(int sk = 0) ;
-
- main()
- {
- string xchar;
- xchar.skip_whitespace(0) ;
- cout << "Input :" << endl;
- cin >> xchar;
- cout << "Output :" << xchar << endl;
-
- return 0;
- }
-
- The purpose in the real program is to read addresses (the ones on
- letters), and I want to read the address lines in one by one.
-
- When a string is inputed such as 12651 West Alabama Apt 203
- I only receive, as output, 12651
- and somehow the rest is put into the remaining cin statements
- variables. The spacing in the input seems critical to the placement of
- the rest of the data. Help screens, and books, talk little about
- letting a space stay in a string field, though they do mention
- something about whitespacing. I do not want to use fixed length
- fields, such as char x[10]
- The length of the string must be dynamic, meaning changing to
- conform to the inputed length.
- I am using Borland 4.5
-
- thanks,
-
- Jim
-
-